minibuffer-completion-help: Fix regression when END < EOB
authorDmitry Gutov <dmitry@gutov.dev>
Thu, 11 Apr 2024 17:33:16 +0000 (20:33 +0300)
committerDmitry Gutov <dmitry@gutov.dev>
Thu, 11 Apr 2024 17:33:16 +0000 (20:33 +0300)
Which can happen with in-buffer completion (though this scenario
is preffed off by default).

* lisp/minibuffer.el (minibuffer-completion-help): Include the
buffer contents after END into BASE-SUFFIX (bug#48356).

lisp/minibuffer.el

index 3d0a6f9694f2324261d17552471e0c67cf295d3d..ad6a0928cda6735bc4e3c73a327eb599e280aca5 100644 (file)
@@ -2600,9 +2600,10 @@ The candidate will still be chosen by `choose-completion' unless
              (minibuffer-completion-base (substring string 0 base-size))
              (base-prefix (buffer-substring (minibuffer--completion-prompt-end)
                                             (+ start base-size)))
-             (base-suffix (completion-base-suffix start end
-                                                  minibuffer-completion-table
-                                                  minibuffer-completion-predicate))
+             (base-suffix (concat (completion-base-suffix start end
+                                                          minibuffer-completion-table
+                                                          minibuffer-completion-predicate)
+                                  (buffer-substring end (point-max))))
              (all-md (completion--metadata (buffer-substring-no-properties
                                             start (point))
                                            base-size md